package com.bfly.mall.product.enums;

/**
 * 产品活动类型
 * @author 长沙商脉科技有限公司
 * @date 2020/9/22 10:24
 */
public enum ProductActivityTypeEnum {
    NONE(0, "没有活动"),
    GROUP_SHOP(1, "团购"),
    SEC_KILL(2,"秒杀");

    ProductActivityTypeEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static ProductActivityTypeEnum getActivityType(int id){
        for(ProductActivityTypeEnum activityType: ProductActivityTypeEnum.values()){
            if(activityType.getId()==id){
                return activityType;
            }
        }
        return null;
    }

    private int id;

    private String name;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
}
